package com.sunny.wordstudy;

import android.app.Activity;
import android.app.AlertDialog.Builder;
import android.app.ProgressDialog;
import android.content.Intent;
import android.content.res.Resources;
import android.net.Uri;
import android.os.Bundle;
import android.widget.Button;
import android.widget.EditText;
import android.widget.ListView;
import android.widget.SimpleAdapter;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import weibo4andriod.a.a;
import weibo4andriod.a.h;
import weibo4andriod.c;
import weibo4andriod.d;
import weibo4andriod.e;

public class OAuthActivity extends Activity
{
  ProgressDialog a = null;
  ListView b;
  List c = new ArrayList();
  List d = new ArrayList();
  long e = 0L;
  long f = 0L;
  boolean g;
  boolean h = false;

  final void a()
  {
    new bn(this).a("", "", 0, "");
    finish();
  }

  final void a(boolean paramBoolean)
  {
    ag.a();
    e locale = ag.b();
    locale.a(ag.a().d(), ag.a().e());
    while (true)
    {
      ArrayList localArrayList;
      long l2;
      int j;
      try
      {
        localArrayList = new ArrayList();
        List localList;
        long l1;
        Iterator localIterator;
        if (paramBoolean)
        {
          localList = locale.a();
          l1 = this.e;
          localIterator = localList.iterator();
          l2 = 0L;
        }
        label78: c localc;
        do
        {
          if (!(localIterator.hasNext()))
          {
            if (!(paramBoolean))
              break label327;
            j = 0;
            if (j < this.c.size())
              break label234;
            this.c = localArrayList;
            break label326:
            localList = locale.b();
            l1 = this.f;
          }
          localc = (c)localIterator.next();
        }
        while (localc.a() <= l1);
        if (localc.a() > l2)
          l2 = localc.a();
        HashMap localHashMap = new HashMap();
        localHashMap.put("item", localc.c().a());
        localHashMap.put("desc", localc.b());
        localHashMap.put("status", localc);
        label326: label234: localArrayList.add(localHashMap);
      }
      catch (Exception localException)
      {
        localException.printStackTrace();
        break label326:
        localArrayList.add((HashMap)this.c.get(j));
        ++j;
        break label78:
        while (true)
        {
          if (i >= this.d.size())
          {
            this.d = localArrayList;
            if (l2 <= 0L)
              break;
            this.f = l2;
            break;
          }
          localArrayList.add((HashMap)this.d.get(i));
          ++i;
        }
        return;
      }
      label327: int i = 0;
    }
  }

  final void b()
  {
    AlertDialog.Builder localBuilder = new AlertDialog.Builder(this);
    localBuilder.setIcon(getResources().getDrawable(2130837511));
    localBuilder.setTitle(getResources().getString(2131099932));
    localBuilder.setMessage(getResources().getString(2131099933));
    EditText localEditText = new EditText(this);
    localBuilder.setView(localEditText);
    localBuilder.setPositiveButton(getResources().getString(2131099786), new ac(this, localEditText));
    localBuilder.setNegativeButton(getResources().getString(2131099787), new ad(this));
    localBuilder.show();
  }

  public final void b(boolean paramBoolean)
  {
    if (paramBoolean);
    for (List localList = this.c; ; localList = this.d)
    {
      String[] arrayOfString = new String[2];
      arrayOfString[0] = "item";
      arrayOfString[1] = "desc";
      int[] arrayOfInt = new int[2];
      arrayOfInt[0] = 16908308;
      arrayOfInt[1] = 16908309;
      SimpleAdapter localSimpleAdapter = new SimpleAdapter(this, localList, 17367044, arrayOfString, arrayOfInt);
      this.b.setAdapter(localSimpleAdapter);
      return;
    }
  }

  public final void c(boolean paramBoolean)
  {
    this.g = paramBoolean;
    if (this.a != null)
      return;
    this.a = new ProgressDialog(this);
    this.a.setTitle(getResources().getString(2131099825));
    this.a.setIcon(2130837511);
    this.a.setMessage(getResources().getString(2131099835));
    this.a.show();
    new ae(this).start();
  }

  public void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    setContentView(2130903049);
    this.b = ((ListView)findViewById(2131230777));
    String str1 = getIntent().getStringExtra("from");
    if ((str1 != null) && (str1.length() > 0))
      new bn(this).a();
    while (true)
    {
      ((Button)findViewById(2131230778)).setOnClickListener(new y(this));
      ((Button)findViewById(2131230779)).setOnClickListener(new z(this));
      ((Button)findViewById(2131230780)).setOnClickListener(new aa(this));
      Button localButton = (Button)findViewById(2131230781);
      localButton.setOnClickListener(new ab(this));
      if (this.h)
        localButton.setVisibility(4);
      c(true);
      return;
      this.h = true;
      Uri localUri = getIntent().getData();
      bn localbn;
      try
      {
        a locala = ag.a().c().b(localUri.getQueryParameter("oauth_verifier"));
        ag.a().a(locala);
        localbn = new bn(this);
        localbn.a(locala.d(), locala.c(), locala.b(), locala.a());
        String str2 = localbn.b();
        if (str2.length() <= 0)
          break label275;
        localbn.c(str2);
      }
      catch (Exception localException)
      {
        localException.printStackTrace();
      }
      continue;
      label275: localbn.c(getResources().getString(2131099927));
    }
  }
}

/* Location:           E:\Desktop\Android\wordstd\classes_dex2jar.jar
 * Qualified Name:     com.sunny.wordstudy.OAuthActivity
 * JD-Core Version:    0.5.3
 */